﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateList.aspx.cs" Inherits="hcms.Admin.TemplateList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>模板列表</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link href="Styles/rightframe.css" rel="stylesheet" type="text/css" />
	<script src="/Scripts/jquery.min.161.js" type="text/javascript"></script>
	<script src="js/admin.js" type="text/javascript"></script>
	<script type="text/javascript">
		function ondelete() {
			if (getcheckedstrid() == false)
				return;

			if (confirm('确定删除?')) {
				$("#cmd").val("delete");
				form1.submit();
			}
		}

		function onedit() {
			var editid = getfirstchecked();
			if (!editid)
				return;

			window.location = "TemplateEdit.aspx?type=<%=type%>&id=" + editid;
		}
	</script>
</head>
<body>
    <form id="form1" runat="server">
	<input type="hidden" id="cmd" runat="server" />
	<input type="hidden" id="sel" runat="server" />
	<div class="topdiv">
		模板管理 &gt;&gt; <%=model.templatesName[type]%>列表&nbsp;&nbsp;&nbsp;
		<input type="button" onclick="window.location='TemplateEdit.aspx?id=0&type=<%=type%>'" value="新建" />&nbsp;
		<input type="button" onclick="onedit()" value="修改" />&nbsp;
		<input type="button" onclick="ondelete()" value="删除" />&nbsp;
	</div>
	<table class="list" cellpadding="0" cellspacing="0">
		<tr>
    	<th class="w30"><input id="ckall" name="ckall" type="checkbox" onclick="chkall(this)"/></th>
		<th class="w60">代号</th>
		<th class="w120">名称</th>
		<th>备注</th>
		</tr>
		<% foreach (System.Data.DataRow row in rows)
	 { %>
		<tr>
		<td><input type="checkbox" name="chk" value="<%=row["temID"]%>" /></td>
		<td><%=row["temID"]%></td>
		<td><a href="TemplateEdit.aspx?id=<%=row["temID"] %>&type=<%=type%>"><%=row["temName"] + "&nbsp;" %></a></td>
		<td><%=row["temDescription"] + "&nbsp;"%></td>
		</tr>
		<%
	 } %>
	</table>
	</form>
</body>
</html>
